How to Use Web Services in ASP.NET Client Side:-
For using of Web Services in ASP.NET Client follow the following steps:-

Step(1):-
Create New ASP.NET Application named is CalculatorWebAppClient as shown in below.



Step 2:- Now we need to add a reference to web service.

To achieve this:-
a) Right click on References folder in the CalculatorWebAppClient project and select Add Service Reference option.

b) In the Address textbox of the Add Service Reference window, type the web service address and click GO button. In the namespace textbox type CalculatorWebServices and click OK as shown in below image.





Step 3:- Right click on CalculatorWebAppClient project in solution explorer and add new webform.

Step 4:- Copy and paste the following HTML code.

  


 <form id="form1" runat="server">
        <center> 
    <div>
        <div style="background-color:#0094ff; font-size:30px; color:white; text-align:center;">Web Services Client for Calculator Demo By santosh-asp.com</div>
    <table>
        <tr> <td colspan="2"> <asp:Label ID="lblMessage" runat="server"></asp:Label></td></tr>
        <tr><td>Enter first number </td>  <td> <asp:TextBox ID="txtFirstNo" runat="server"></asp:TextBox> </td> </tr>
        <tr><td>Enter second number </td>  <td> <asp:TextBox ID="txtSecondNo" runat="server"></asp:TextBox> </td> </tr>
        <tr><td><asp:Button ID="btnAddtion" runat="server" Text="Addition" Width="120px" Font-Bold="true" OnClick="btnAddtion_Click" /> </td>  <td> <asp:Button ID="btnSubtration" runat="server" Text="Subtration" Width="120px" Font-Bold="true" /> </td> </tr>
        <tr><td><asp:Button ID="btnMultiplication" runat="server" Text="Multiplication" Width="120px" Font-Bold="true" /> </td>  <td> <asp:Button ID="btnDivision" runat="server" Text="Division" Width="120px" Font-Bold="true" /> </td> </tr>

    </table>
    </div>
            </center>
    </form>

            


Step 5- Copy and paste the following code in the code-behind file

 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CalculatorWebAppClient
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        //create the object of Service
        ServiceReference1.Service1SoapClient objService = new ServiceReference1.Service1SoapClient();
        protected void Page_Load(object sender, EventArgs e)
        {

        }


        //addtion code
        protected void btnAddtion_Click(object sender, EventArgs e)
        {
            int firstno = Convert.ToInt32(txtFirstNo.Text);
            int secondno = Convert.ToInt32(txtSecondNo.Text);
           
           int add= objService.Addition(firstno,secondno);
           lblMessage.Text ="The addition of two number  "+ add.ToString();

        }

        //subtration
        protected void btnSubtration_Click(object sender, EventArgs e)
        {
            int firstno = Convert.ToInt32(txtFirstNo.Text);
            int secondno = Convert.ToInt32(txtSecondNo.Text);

            int sub = objService.Subtration(firstno, secondno);
            lblMessage.Text ="The subtration of two number  "+ sub.ToString();
        }

        //multiplication
        protected void btnMultiplication_Click(object sender, EventArgs e)
        {
            int firstno = Convert.ToInt32(txtFirstNo.Text);
            int secondno = Convert.ToInt32(txtSecondNo.Text);

            int mul = objService.Multiplication(firstno, secondno);
            lblMessage.Text ="The multiplication of two number  "+ mul.ToString();
        }

        //division
        protected void btnDivision_Click(object sender, EventArgs e)
        {
            int firstno = Convert.ToInt32(txtFirstNo.Text);
            int secondno = Convert.ToInt32(txtSecondNo.Text);

            int div = objService.Devision(firstno, secondno);
            lblMessage.Text ="The division of two number  "+ div.ToString();
        }
    }
}



Step(6):-Now, run the application and get output as expected.